package org.dna.metronomo.persistence;

/**
 * Enum to define the status of some not physically removable entities. An entity
 * should be marked as DELETED when it has got associated data that can't be removed
 * physically from the persitence layer.
 * */
public enum StatusEnum {

    DELETED("DELETED"), VALID("VALID");
    private final String value;

    StatusEnum(String value) {
        this.value = value;
    }

    public static StatusEnum getEnum(String status) {
        for (StatusEnum e : StatusEnum.values()) {
            if (status.equals(e.value())) {
                return e;
            }
        }
        return null;
    }

    public String value() {
        return value;
    }
}
